package org.qee.activemq;

import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.Session;

public class Producer {

    private MessageProducer messageProducer;

    private Session session;

    public Producer(MessageProducer messageProducer, Session session) {
        this.messageProducer = messageProducer;
        this.session = session;
    }

    public void send(String msg) {
        try {
            messageProducer.send(session.createTextMessage(msg));
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
